#include <iostream>

using namespace std;

int main()
{
	int result = 1, n = 1;

	for(int i=1;i<=1001/2;i++)
	{
		int j = 2*i;
		result += n+=j;
		result += n+=j;
		result += n+=j;
		result += n+=j;
	}

	cout << result << endl;
	return 0;
}
